package com.misyi.designpattern.adapter;

/**
 * 没有使用迭代器
 *
 * @author licong
 * @date 2021-09-10 下午9:59
 */
public class WithoutAdapterPatternDemo {

    public static void main(String[] args) {
        OldInterface oldInterface = new OldInterfaceImpl();
        oldInterface.oldExecute();
        NewInterface newInterface = new NewInterfaceImpl();
        newInterface.newExecute();
    }


    public interface OldInterface {
        void oldExecute();
    }

    public static class OldInterfaceImpl implements OldInterface {

        @Override
        public void oldExecute() {
            System.out.println("老的执行方法!");
        }
    }

    public interface NewInterface {
        void newExecute();
    }

    public static class NewInterfaceImpl implements NewInterface {

        @Override
        public void newExecute() {
            System.out.println("新的执行方法");
        }
    }

}
